/**
 * 
 */
package com.nari.baseinfo.action;

import java.io.File;
import java.io.FileInputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.ListUtils;
import org.apache.commons.collections.Transformer;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.json.JSONUtil;
import org.apache.struts2.json.annotations.JSON;

import com.nari.baseinfo.model.IBuilding;
import com.nari.baseinfo.model.ICommunity;
import com.nari.baseinfo.model.IFileMapping;
import com.nari.baseinfo.model.IHeatMeter;
import com.nari.baseinfo.model.IProject;
import com.nari.baseinfo.model.IShareArea;
import com.nari.baseinfo.service.IBuildingService;
import com.nari.baseinfo.service.ICityService;
import com.nari.baseinfo.service.ICommunityService;
import com.nari.baseinfo.service.IFileMappingService;
import com.nari.baseinfo.service.IHeatMeterService;
import com.nari.baseinfo.service.IProjectService;
import com.nari.baseinfo.service.IShareAreaService;
import com.nari.coreframe.action.struts2.JSONActionSupport;
import com.nari.platform.model.PageCond;
import com.nari.platform.model.ResponseMsg;
import com.nari.platform.model.ResultWithPageCond;
import com.opensymphony.xwork2.Action;
import com.sohoometer.base.action.BaseAction;
import com.sohoometer.web.bean.CommunityInfo;
import com.sohoometer.web.excel.ExcelInputUtils;
import com.sohoometer.web.excel.HeatMeterImport;

/**
 * 
 * @author Xiaopeng
 * @date 2013-8-1
 */
public class HeatMeterAction extends BaseAction {
	private static final long serialVersionUID = -6673575532300566926L;
	private IHeatMeterService iHeatMeterService;
	private ICityService iCityService;
	private IProjectService iProjectService;
	private ICommunityService iCommunityService;
	private IShareAreaService iShareAreaService;
	private IBuildingService iBuildingService;
	private IFileMappingService iFileMappingService;
	//热量表信息查询
	private String projectUID;
	private String communityUID;
	private String meterNo;
	private String meterType;
	private List<IProject> projectList;
	private List<IBuilding> buildingList;
	//分页查询
	private int pageIndex = 1; //默认查询第一页列表
	private PageCond pageCond;
	private int pageSize;
	private ResultWithPageCond<IHeatMeter> heatMeterPage;
	private Map<String, String> pageCityMap; //所属城市id-cityName映射表
	private Map<String, String> pageProjectMap; //所属项目id-projectName映射表
	private Map<String, String> pageCommunityMap; //所属小区id-communityName映射表
	private Map<String, String> pageBuildingMap; //所属楼栋id-buildingName映射表
	//热量表信息管理
	private String heatMeterUID;
	private IHeatMeter heatMeter;
	private String shareAreaUID;
	private List<ICommunity> communityList;
	private List<IShareArea> shareAreaList;
	private IFileMapping attachFileMap;
	//安装照片附件
	private File attachFile;
	private String attachFileFileName;
	//热量表详细信息
	private IProject project;
	private ICommunity community;
	private IBuilding building;
	private IShareArea shareArea;
	//热量表列表查询
	private String buildingUID;
	private List<IHeatMeter> heatMeterList;
	//设置热量表所属分摊域
	private String meterIDList;
	private String meterOptions;
	
	/**
	 * 分页查询热量表信息
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-12
	 */
	public String queryHeatMeterPage() throws Exception {
		//所属项目列表
		this.projectList = this.iProjectService.queryAllProjectInOrder();
		if(this.projectList == null) {
			this.projectList = new ArrayList<IProject>();
		}
		//所属小区列表
		if(this.projectUID!=null && !"".equals(projectUID)) {
			this.communityList = this.iCommunityService.queryCommunitysByBelongings(null, null, null, projectUID);
		} else {
			this.communityList = new ArrayList<ICommunity>();
		}
		// 所属楼栋列表
		if ((this.projectUID != null && !"".equals(projectUID))
				|| (this.communityUID != null && !"".equals(communityUID))) {
			this.buildingList = this.iBuildingService
					.queryBuildingByBelongings(projectUID, communityUID);
		} else {
			this.buildingList = new ArrayList<IBuilding>();
		}
		//分页信息
		this.pageCond = new PageCond();
		int start = (this.pageIndex - 1) * this.pageCond.getLimit();
		this.pageCond.setStart(start);
		//分页结果
//		this.heatMeterPage = this.iHeatMeterService.queryHeatMeterPage(projectUID, communityUID, meterNo, meterType, pageCond);
		this.heatMeterPage = this.iHeatMeterService.queryHeatMeterPage(projectUID, communityUID, buildingUID, null, meterNo, meterType, pageCond);
		//计算结果集的页数
		this.pageSize = new BigDecimal(this.heatMeterPage.getPageCond().getTotal())
				.divide(new BigDecimal(this.heatMeterPage.getPageCond().getLimit()), RoundingMode.UP).intValue();
		if(pageSize == 0) pageSize = 1;
		//项目映射表
		this.pageProjectMap = new HashMap<String, String>();
		for(IProject project: this.projectList) {
			this.pageProjectMap.put(project.getId(), project.getProjectName());
		}
		//小区映射表
		this.pageCommunityMap = this.iHeatMeterService.queryReferCommunitysByMeterList(heatMeterPage.getList());
		//楼栋映射表
		this.pageBuildingMap = iHeatMeterService.queryReferBuildingsByMeterList(heatMeterPage.getList());
		return "heatMeterPage";
	}
	
	/**
	 * 热量表信息管理
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-13
	 */
	public String queryHeatMeterForManage() throws Exception {
		//热量表信息
		if(this.heatMeterUID!=null && !"".equals(heatMeterUID)) {
			this.heatMeter = this.iHeatMeterService.queryEntityById(heatMeterUID);
			//所属项目
			this.projectUID = this.heatMeter.getProjectID();
			//所属小区
			this.communityUID = this.heatMeter.getCommunityID();
			//安装照片附件
			if(heatMeter.getInstallPic()!=null && !"".equals(heatMeter.getInstallPic().trim())) {
				this.attachFileMap = this.iFileMappingService.queryEntityById(heatMeter.getInstallPic());
			}
		}
		//所属项目列表
		this.projectList = this.iProjectService.queryAllProjectInOrder();
		if(this.projectList == null) {
			this.projectList = new ArrayList<IProject>();
		}
		//所属小区列表
		if(this.projectUID!=null && !"".equals(projectUID)) {
			this.communityList = this.iCommunityService.queryCommunitysByBelongings(null, null, null, projectUID);
		} else {
			this.communityList = new ArrayList<ICommunity>();
		}
		// 所属楼栋列表
		if((this.projectUID != null && !"".equals(projectUID))
				|| (this.communityUID != null && !"".equals(communityUID))) {
			this.buildingList = this.iBuildingService.queryBuildingByBelongings(projectUID, communityUID);
		} else {
			this.buildingList = new ArrayList<IBuilding>();
		}
		return "heatMeterManage";
	}
	
	/**
	 * 新增或修改热量表信息，及热量表安装照片附件上传
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-14
	 */
	public String saveOrUpdateHeatMeter() throws Exception {
		this.rmsg = this.iHeatMeterService.saveOrUpdateHeatMeter(heatMeter, attachFile, attachFileFileName);
		this.heatMeterInfoSubmitResponse(JSONUtil.serialize(this.rmsg));
		return Action.SUCCESS;
	}
	
	/**
	 * 热量表信息提交响应信息
	 * @param rmsg
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-14
	 */
	private void heatMeterInfoSubmitResponse(String rmsg) throws Exception {
		StringBuffer resMsg = new StringBuffer("<script type='text/javascript'>");
		resMsg.append("parent.uploadCallBack('");
		resMsg.append(rmsg);
		resMsg.append("')");
		resMsg.append("</script>");
		this.writeJsonStrToResponse(resMsg.toString());
	}
	
	/**
	 * 异步删除安装照片附件
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-13
	 */
	public String deletePicAttachFile() throws Exception {
		this.rmsg = this.iHeatMeterService.deleteMeterPicAttachFile(heatMeterUID);
		this.writeJsonStrToResponse(JSONUtil.serialize(rmsg));
		return Action.SUCCESS;
	}
	
	/**
	 * 热量表信息删除，及热量表安装照片删除
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-14
	 */
	public String deleteHeatMeterByUID() throws Exception {
		this.rmsg = this.iHeatMeterService.deleteHeatMeterByUID(heatMeterUID);
		this.writeJsonStrToResponse(JSONUtil.serialize(rmsg));
		return Action.SUCCESS;
	}
	
	/**
	 * 查询热量表详细信息
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-26
	 */
	@SuppressWarnings("unchecked")
	public String queryHeatMeterDetailInfo() throws Exception {
		if(this.heatMeterUID!=null && !"".equals(heatMeterUID)) {
			this.heatMeter = this.iHeatMeterService.queryEntityById(heatMeterUID);
			//所属城市
			this.pageCityMap = this.iHeatMeterService.queryReferCitysByMeterList(Arrays.asList(new IHeatMeter[]{this.heatMeter}));
			//所属项目
			this.project = this.iProjectService.queryEntityById(heatMeter.getProjectID());
			//所属小区
			this.community = this.iCommunityService.queryEntityById(heatMeter.getCommunityID());
			//所属楼栋
			if(heatMeter.getBuildingID()!=null && !"".equals(heatMeter.getBuildingID())) {
				this.building = this.iBuildingService.queryEntityById(heatMeter.getBuildingID());
			}
			//所属分摊域
			if(heatMeter.getShareAreaID()!=null && !"".equals(heatMeter.getShareAreaID())) {
				this.shareArea = this.iShareAreaService.queryEntityById(heatMeter.getShareAreaID());
			}
			//安装照片附件
			if(heatMeter.getInstallPic()!=null && !"".equals(heatMeter.getInstallPic().trim())) {
				this.attachFileMap = this.iFileMappingService.queryEntityById(heatMeter.getInstallPic());
			}
		}
		return "meterDetail";
	}
	
	/**
	 * 通过所属关系查询热量表列表
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-8-30
	 */
	public String queryMetersByBelongs() throws Exception {
		this.heatMeterList = this.iHeatMeterService.queryMetersByBelongs(projectUID, communityUID, buildingUID, shareAreaUID);
		this.writeJsonStrToResponse(JSONUtil.serialize(this.heatMeterList));
		return Action.SUCCESS;
	}
	
	/**
	 * 根据所属分摊域查询热量表列表
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-9-3
	 */
	public String queryMeterPageByAreaUID() throws Exception {
		if(shareAreaUID!=null && !"".equals(shareAreaUID)) {
			//分摊域信息
			this.shareArea = this.iShareAreaService.queryEntityById(shareAreaUID);
			//分摊域所属项目、小区
			this.projectUID = this.shareArea.getProjectID();
			this.communityUID = this.shareArea.getCommunityID();
		}
		//分页信息
		this.pageCond = new PageCond();
		int start = (this.pageIndex - 1) * this.pageCond.getLimit();
		this.pageCond.setStart(start);
		//分页结果
		this.heatMeterPage = this.iHeatMeterService.queryHeatMeterPageByAreaUID(shareAreaUID, projectUID, communityUID, meterNo, pageCond);
		//计算结果集的页数
		this.pageSize = new BigDecimal(this.heatMeterPage.getPageCond().getTotal())
				.divide(new BigDecimal(this.heatMeterPage.getPageCond().getLimit()), RoundingMode.UP).intValue();
		if(pageSize == 0) pageSize = 1;
		//楼栋映射表
		this.pageBuildingMap = iHeatMeterService.queryReferBuildingsByMeterList(heatMeterPage.getList());
		return "areaMeterPage";
	}
	
	/**
	 * 分页查询不在某一分摊域下的热量表列表(用于设置热量表所属的分摊域)
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-9-3
	 */
	public String queryMeterPageForAreaAssign() throws Exception {
		if(shareAreaUID!=null && !"".equals(shareAreaUID)) {
			//分摊域信息
			this.shareArea = this.iShareAreaService.queryEntityById(shareAreaUID);
			//分摊域所属项目、小区
			this.projectUID = this.shareArea.getProjectID();
			this.communityUID = this.shareArea.getCommunityID();
		}
		//分页信息
		this.pageCond = new PageCond();
		int start = (this.pageIndex - 1) * this.pageCond.getLimit();
		this.pageCond.setStart(start);
		//分页结果
		this.heatMeterPage = this.iHeatMeterService.queryMeterPageExceptAreaUID(shareAreaUID, projectUID, communityUID, meterNo, pageCond);
		// 计算结果集的页数
		this.pageSize = new BigDecimal(this.heatMeterPage.getPageCond().getTotal())
				.divide(new BigDecimal(this.heatMeterPage.getPageCond().getLimit()), RoundingMode.UP).intValue();
		if (pageSize == 0) pageSize = 1;
		//项目映射表
		this.pageProjectMap = iHeatMeterService.queryReferProjectsByMeterList(heatMeterPage.getList());
		//小区映射表
		this.pageCommunityMap = this.iHeatMeterService.queryReferCommunitysByMeterList(heatMeterPage.getList());
		//楼栋映射表
		this.pageBuildingMap = iHeatMeterService.queryReferBuildingsByMeterList(heatMeterPage.getList());
		return "areaMeterAssign";
	}
	
	/**
	 * 设置热量表所属分摊域
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-9-3
	 */
	public String assignHeatMeterArea() throws Exception {
		this.rmsg = this.iHeatMeterService.saveHeatMeterAreaConfig(shareAreaUID, meterOptions);
		this.writeJsonStrToResponse(JSONUtil.serialize(this.rmsg));
		return Action.SUCCESS;
	}
	
	/**
	 * 取消热量表所属分摊域设置
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-9-3
	 */
	public String cancelAreaHeatMeterByUID() throws Exception {
		this.heatMeter = this.iHeatMeterService.queryEntityById(heatMeterUID);
		this.heatMeter.setShareAreaID(null);
		this.iHeatMeterService.updateEntity(heatMeter, heatMeterUID);
		this.writeJsonStrToResponse(JSONUtil.serialize(ResponseMsg.getInstance(true, "")));
		return Action.SUCCESS;
	}
	
	/**
	 * 下载热量表上传模板
	 * */
	public String downloadTemplate() throws Exception{
		ExcelInputUtils utils = new ExcelInputUtils();
		setTargetFile(utils.getTemplateFile());
		setOutputFileName("热量表导入模板.xls");
		return "downloadTemplate";
	}
	/*
	 *上传热量表文件 
	 **/
	public String uploadHeatMeter() throws Exception{
		ExcelInputUtils utils = new ExcelInputUtils();
		queryMap();
		FileInputStream inputStream = null;
		try {
			inputStream = new FileInputStream(attachFile);
		 HeatMeterImport heatMeters = utils.parseHeatMeters(inputStream, (HashMap<String, String>) infoMap);
		 if(!heatMeters.isSuccess()) {
			 ResponseMsg wrong = ResponseMsg.getInstance(false);
			 wrong.setMsg(heatMeters.getWrongMsg());
			 writeResponseToFileAsyncSubmit(JSONUtil.serialize(wrong));
			 return null;
		 }
		 String projectID = heatMeters.getProjectID();
		 final IProject iProject = iProjectService.queryEntityById(projectID);
		 if(iProject==null) {
			 ResponseMsg instance = ResponseMsg.getInstance(false,"请确认工程存在");
			 writeResponseToFileAsyncSubmit(JSONUtil.serialize(instance));
			 return null;
		 }
		 ArrayList<IHeatMeter> importheatMeter = heatMeters.getHeatMeter();
		 Map<String, CommunityInfo> communityMap = queryCommunityMap(iProject.getId());
		 Map<String, String> buildingMap =  null;
		 for(IHeatMeter heatMeter:importheatMeter) {
				String capitalCityID = iProject.getCapitalCityID();
				String provinceCityID = iProject.getProvinceCityID();
				heatMeter.setCapitalCityID(capitalCityID);
				heatMeter.setProvinceCityID(provinceCityID);
				String community = heatMeter.getCommunityID();//得到小区名称
				  CommunityInfo communityInfo = communityMap.get(community);
				  if(communityInfo==null) {
					  ResponseMsg instance = ResponseMsg.getInstance(false,"请确认热量表号【"+heatMeter.getMeterNo()+"】的【小区名称】正确且已经录入档案中");
						 writeResponseToFileAsyncSubmit(JSONUtil.serialize(instance));
						 return null;
				  }
				String communityID = communityInfo.getCommunityId();
				//设置三级区域ID
				String distic_id = communityInfo.getDistic_id();
				heatMeter.setDistrictCityID(distic_id);
				
				if(StringUtils.isBlank(communityID)) {
				 ResponseMsg instance = ResponseMsg.getInstance(false,"请确认热量表号【"+heatMeter.getMeterNo()+"】的【小区名称】正确且已经录入档案中");
				 writeResponseToFileAsyncSubmit(JSONUtil.serialize(instance));
				 return null;}
				heatMeter.setCommunityID(communityID);
				
				
				String building = heatMeter.getBuildingID();
				if(buildingMap==null||buildingMap.get(building)==null) {
					buildingMap = queryBuildingMap(projectID, communityID);
				}
				String buildingId = buildingMap.get(building);
				if(StringUtils.isBlank(buildingId)) {
					 ResponseMsg instance = ResponseMsg.getInstance(false,"请确认热量表号【"+heatMeter.getMeterNo()+"】的【楼栋名称】正确且已经录入档案中");
					 writeResponseToFileAsyncSubmit(JSONUtil.serialize(instance));
					 return null;}
				heatMeter.setBuildingID(buildingId);
		 }
		 iHeatMeterService.saveHeatMeter(importheatMeter);//保存应该覆盖原来的
			ResponseMsg responseMsg = ResponseMsg.getInstance(true);
//			writeJsonStrToResponse(JSONUtil.serialize(responseMsg));
			writeResponseToFileAsyncSubmit(JSONUtil.serialize(responseMsg));
		} catch (Exception e) {
			ResponseMsg instance2 = ResponseMsg.getInstance(false, "请检查文件格式是否正确");
			writeResponseToFileAsyncSubmit(JSONUtil.serialize(instance2));
			return null;
		}finally {
			IOUtils.closeQuietly(inputStream);
		}
		return  null;
	}
	/**
	 * 热量表上传页面
	 * */
	public String uploadPage() throws Exception{
		return "uploadPage";
	}
	
private 	Map<String,String> queryProjectMap() throws Exception{
	//所属项目列表
			this.projectList = this.iProjectService.queryAllProjectInOrder();
			if(this.projectList == null) {
				this.projectList = new ArrayList<IProject>();
			}
	//项目映射表
	HashMap<String, String> projectMap = new HashMap<String, String>();
			for(IProject project: this.projectList) {
				this.pageProjectMap.put(project.getProjectName(),project.getId());
			}
			return projectMap;
	}
private 	Map<String,CommunityInfo> queryCommunityMap(String projectId) throws Exception{
	//所属小区列表
	if(projectId!=null && !"".equals(projectId)) {
		this.communityList = this.iCommunityService.queryCommunitysByBelongings(null, null, null, projectId);
	} else {
		this.communityList = new ArrayList<ICommunity>();
	}
	HashMap<String, CommunityInfo> communityMap = new HashMap<String, CommunityInfo>();
	for(ICommunity community :communityList) {
		CommunityInfo communityInfo = new CommunityInfo();
		communityInfo.setCommunityId(community.getId());
		communityInfo.setDistic_id(community.getDistrictCityID());
		communityMap.put(community.getCommunityName(),communityInfo);
	}
	return communityMap;
}
private 	Map<String,String> queryBuildingMap(String projectId,String communityId) throws Exception{
	// 所属楼栋列表
	HashMap<String, String> buildingmap = new HashMap<String, String>(); 
	if((projectId != null && !"".equals(projectId))
			|| (communityId != null && !"".equals(communityId))) {
		this.buildingList = this.iBuildingService.queryBuildingByBelongings(projectId, communityId);
	} else {
		this.buildingList = new ArrayList<IBuilding>();
	}
	for(IBuilding building:buildingList) {
		buildingmap.put(building.getBuildingName(), building.getId());
	}
	return buildingmap;
}
	
	/**
	 * @return the iHeatMeterService
	 */
	@JSON(serialize=false)
	public IHeatMeterService getiHeatMeterService() {
		return iHeatMeterService;
	}
	
	/**
	 * @param iHeatMeterService the iHeatMeterService to set
	 */
	public void setiHeatMeterService(IHeatMeterService iHeatMeterService) {
		this.iHeatMeterService = iHeatMeterService;
	}

	/**
	 * @return the iCityService
	 */
	@JSON(serialize=false)
	public ICityService getiCityService() {
		return iCityService;
	}

	/**
	 * @param iCityService the iCityService to set
	 */
	public void setiCityService(ICityService iCityService) {
		this.iCityService = iCityService;
	}

	/**
	 * @return the iProjectService
	 */
	@JSON(serialize=false)
	public IProjectService getiProjectService() {
		return iProjectService;
	}

	/**
	 * @param iProjectService the iProjectService to set
	 */
	public void setiProjectService(IProjectService iProjectService) {
		this.iProjectService = iProjectService;
	}

	/**
	 * @return the iCommunityService
	 */
	@JSON(serialize=false)
	public ICommunityService getiCommunityService() {
		return iCommunityService;
	}

	/**
	 * @param iCommunityService the iCommunityService to set
	 */
	public void setiCommunityService(ICommunityService iCommunityService) {
		this.iCommunityService = iCommunityService;
	}

	/**
	 * @return the iShareAreaService
	 */
	@JSON(serialize=false)
	public IShareAreaService getiShareAreaService() {
		return iShareAreaService;
	}

	/**
	 * @param iShareAreaService the iShareAreaService to set
	 */
	public void setiShareAreaService(IShareAreaService iShareAreaService) {
		this.iShareAreaService = iShareAreaService;
	}

	/**
	 * @return the iBuildingService
	 */
	@JSON(serialize=false)
	public IBuildingService getiBuildingService() {
		return iBuildingService;
	}

	/**
	 * @param iBuildingService the iBuildingService to set
	 */
	public void setiBuildingService(IBuildingService iBuildingService) {
		this.iBuildingService = iBuildingService;
	}

	/**
	 * @return the iFileMappingService
	 */
	@JSON(serialize=false)
	public IFileMappingService getiFileMappingService() {
		return iFileMappingService;
	}

	/**
	 * @param iFileMappingService the iFileMappingService to set
	 */
	public void setiFileMappingService(IFileMappingService iFileMappingService) {
		this.iFileMappingService = iFileMappingService;
	}

	/**
	 * @return the projectUID
	 */
	public String getProjectUID() {
		return projectUID;
	}

	/**
	 * @param projectUID the projectUID to set
	 */
	public void setProjectUID(String projectUID) {
		this.projectUID = projectUID;
	}

	/**
	 * @return the communityUID
	 */
	public String getCommunityUID() {
		return communityUID;
	}

	/**
	 * @param communityUID the communityUID to set
	 */
	public void setCommunityUID(String communityUID) {
		this.communityUID = communityUID;
	}

	/**
	 * @return the meterNo
	 */
	public String getMeterNo() {
		return meterNo;
	}

	/**
	 * @param meterNo the meterNo to set
	 */
	public void setMeterNo(String meterNo) {
		this.meterNo = meterNo;
	}

	/**
	 * @return the meterType
	 */
	public String getMeterType() {
		return meterType;
	}

	/**
	 * @param meterType the meterType to set
	 */
	public void setMeterType(String meterType) {
		this.meterType = meterType;
	}

	/**
	 * @return the projectList
	 */
	public List<IProject> getProjectList() {
		return projectList;
	}

	/**
	 * @param projectList the projectList to set
	 */
	public void setProjectList(List<IProject> projectList) {
		this.projectList = projectList;
	}

	/**
	 * @return the buildingList
	 */
	public List<IBuilding> getBuildingList() {
		return buildingList;
	}

	/**
	 * @param buildingList the buildingList to set
	 */
	public void setBuildingList(List<IBuilding> buildingList) {
		this.buildingList = buildingList;
	}

	/**
	 * @return the pageIndex
	 */
	public int getPageIndex() {
		return pageIndex;
	}

	/**
	 * @param pageIndex the pageIndex to set
	 */
	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	/**
	 * @return the pageCond
	 */
	public PageCond getPageCond() {
		return pageCond;
	}

	/**
	 * @param pageCond the pageCond to set
	 */
	public void setPageCond(PageCond pageCond) {
		this.pageCond = pageCond;
	}

	/**
	 * @return the pageSize
	 */
	public int getPageSize() {
		return pageSize;
	}

	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	/**
	 * @return the heatMeterPage
	 */
	public ResultWithPageCond<IHeatMeter> getHeatMeterPage() {
		return heatMeterPage;
	}

	/**
	 * @param heatMeterPage the heatMeterPage to set
	 */
	public void setHeatMeterPage(ResultWithPageCond<IHeatMeter> heatMeterPage) {
		this.heatMeterPage = heatMeterPage;
	}

	/**
	 * @return the pageCityMap
	 */
	public Map<String, String> getPageCityMap() {
		return pageCityMap;
	}

	/**
	 * @param pageCityMap the pageCityMap to set
	 */
	public void setPageCityMap(Map<String, String> pageCityMap) {
		this.pageCityMap = pageCityMap;
	}

	/**
	 * @return the pageProjectMap
	 */
	public Map<String, String> getPageProjectMap() {
		return pageProjectMap;
	}

	/**
	 * @param pageProjectMap the pageProjectMap to set
	 */
	public void setPageProjectMap(Map<String, String> pageProjectMap) {
		this.pageProjectMap = pageProjectMap;
	}

	/**
	 * @return the pageCommunityMap
	 */
	public Map<String, String> getPageCommunityMap() {
		return pageCommunityMap;
	}

	/**
	 * @param pageCommunityMap the pageCommunityMap to set
	 */
	public void setPageCommunityMap(Map<String, String> pageCommunityMap) {
		this.pageCommunityMap = pageCommunityMap;
	}

	/**
	 * @return the pageBuildingMap
	 */
	public Map<String, String> getPageBuildingMap() {
		return pageBuildingMap;
	}

	/**
	 * @param pageBuildingMap the pageBuildingMap to set
	 */
	public void setPageBuildingMap(Map<String, String> pageBuildingMap) {
		this.pageBuildingMap = pageBuildingMap;
	}

	/**
	 * @return the heatMeterUID
	 */
	public String getHeatMeterUID() {
		return heatMeterUID;
	}

	/**
	 * @param heatMeterUID the heatMeterUID to set
	 */
	public void setHeatMeterUID(String heatMeterUID) {
		this.heatMeterUID = heatMeterUID;
	}

	/**
	 * @return the heatMeter
	 */
	public IHeatMeter getHeatMeter() {
		return heatMeter;
	}

	/**
	 * @param heatMeter the heatMeter to set
	 */
	public void setHeatMeter(IHeatMeter heatMeter) {
		this.heatMeter = heatMeter;
	}

	/**
	 * @return the shareAreaUID
	 */
	public String getShareAreaUID() {
		return shareAreaUID;
	}

	/**
	 * @param shareAreaUID the shareAreaUID to set
	 */
	public void setShareAreaUID(String shareAreaUID) {
		this.shareAreaUID = shareAreaUID;
	}

	/**
	 * @return the communityList
	 */
	public List<ICommunity> getCommunityList() {
		return communityList;
	}

	/**
	 * @param communityList the communityList to set
	 */
	public void setCommunityList(List<ICommunity> communityList) {
		this.communityList = communityList;
	}

	/**
	 * @return the shareAreaList
	 */
	public List<IShareArea> getShareAreaList() {
		return shareAreaList;
	}

	/**
	 * @param shareAreaList the shareAreaList to set
	 */
	public void setShareAreaList(List<IShareArea> shareAreaList) {
		this.shareAreaList = shareAreaList;
	}

	/**
	 * @return the attachFileMap
	 */
	public IFileMapping getAttachFileMap() {
		return attachFileMap;
	}

	/**
	 * @param attachFileMap the attachFileMap to set
	 */
	public void setAttachFileMap(IFileMapping attachFileMap) {
		this.attachFileMap = attachFileMap;
	}

	/**
	 * @return the attachFile
	 */
	public File getAttachFile() {
		return attachFile;
	}

	/**
	 * @param attachFile the attachFile to set
	 */
	public void setAttachFile(File attachFile) {
		this.attachFile = attachFile;
	}

	/**
	 * @return the attachFileFileName
	 */
	public String getAttachFileFileName() {
		return attachFileFileName;
	}

	/**
	 * @param attachFileFileName the attachFileFileName to set
	 */
	public void setAttachFileFileName(String attachFileFileName) {
		this.attachFileFileName = attachFileFileName;
	}

	/**
	 * @return the project
	 */
	public IProject getProject() {
		return project;
	}

	/**
	 * @param project the project to set
	 */
	public void setProject(IProject project) {
		this.project = project;
	}

	/**
	 * @return the community
	 */
	public ICommunity getCommunity() {
		return community;
	}

	/**
	 * @param community the community to set
	 */
	public void setCommunity(ICommunity community) {
		this.community = community;
	}

	/**
	 * @return the building
	 */
	public IBuilding getBuilding() {
		return building;
	}

	/**
	 * @param building the building to set
	 */
	public void setBuilding(IBuilding building) {
		this.building = building;
	}

	/**
	 * @return the shareArea
	 */
	public IShareArea getShareArea() {
		return shareArea;
	}

	/**
	 * @param shareArea the shareArea to set
	 */
	public void setShareArea(IShareArea shareArea) {
		this.shareArea = shareArea;
	}

	/**
	 * @return the buildingUID
	 */
	public String getBuildingUID() {
		return buildingUID;
	}

	/**
	 * @param buildingUID the buildingUID to set
	 */
	public void setBuildingUID(String buildingUID) {
		this.buildingUID = buildingUID;
	}

	/**
	 * @return the heatMeterList
	 */
	public List<IHeatMeter> getHeatMeterList() {
		return heatMeterList;
	}

	/**
	 * @param heatMeterList the heatMeterList to set
	 */
	public void setHeatMeterList(List<IHeatMeter> heatMeterList) {
		this.heatMeterList = heatMeterList;
	}

	/**
	 * @return the meterIDList
	 */
	public String getMeterIDList() {
		return meterIDList;
	}

	/**
	 * @param meterIDList the meterIDList to set
	 */
	public void setMeterIDList(String meterIDList) {
		this.meterIDList = meterIDList;
	}

	/**
	 * @return the meterOptions
	 */
	public String getMeterOptions() {
		return meterOptions;
	}

	/**
	 * @param meterOptions the meterOptions to set
	 */
	public void setMeterOptions(String meterOptions) {
		this.meterOptions = meterOptions;
	}
	
}
